<?php 
    Class CurrencyHelper extends AppHelper{
        
        public function formatCurrency($value=null){
            $result='';
            while(strlen($value)>3){
                $sub=substr($value,-3);
                $value=substr($value,0,strlen($value)-3);
                $result='.'.$sub.$result;
            }
            return $value.$result;
        }
        public function codeOrder($value=null){
            while (strlen($value)<5) {
                $value='0'.$value;
            }
            return $value;
        }
    }